package com.ssy.lingxi.order.model.dto;

import java.io.Serializable;
import java.util.Objects;

/**
 * 会员Id、会员角色Id、会员名称作为中间对象DTO
 * @author 万宁
 * @version 2.0.0
 * @date 2021-08-08
 */
public class MemberDTO implements Serializable {
    private static final long serialVersionUID = 5749596270780795036L;

    public MemberDTO(Long memberId, Long roleId) {
        this.memberId = memberId;
        this.roleId = roleId;
        this.name = "";
    }

    public MemberDTO(Long memberId, Long roleId, String name) {
        this.memberId = memberId;
        this.roleId = roleId;
        this.name = name;
    }

    public MemberDTO(Long buyerMemberId, Long buyerRoleId, Long memberId, Long roleId, String name) {
        this.buyerMemberId = buyerMemberId;
        this.buyerRoleId = buyerRoleId;
        this.memberId = memberId;
        this.roleId = roleId;
        this.name = name;
    }

    /**
     * 采购商会员id
     */
    private Long buyerMemberId;

    /**
     * 采购商会员角色id
     */
    private Long buyerRoleId;

    /**
     * 会员Id
     */
    private Long memberId;

    /**
     * 会员角色Id
     */
    private Long roleId;

    /**
     * 会员名称
     */
    private String name;

    public Long getBuyerMemberId() {
        return buyerMemberId;
    }

    public void setBuyerMemberId(Long buyerMemberId) {
        this.buyerMemberId = buyerMemberId;
    }

    public Long getBuyerRoleId() {
        return buyerRoleId;
    }

    public void setBuyerRoleId(Long buyerRoleId) {
        this.buyerRoleId = buyerRoleId;
    }

    public Long getMemberId() {
        return memberId;
    }

    public void setMemberId(Long memberId) {
        this.memberId = memberId;
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }

        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        MemberDTO memberDTO = (MemberDTO) o;
        return buyerMemberId.equals(memberDTO.buyerMemberId) &&
                buyerRoleId.equals(memberDTO.buyerRoleId) &&
                memberId.equals(memberDTO.memberId) &&
                roleId.equals(memberDTO.roleId) &&
                Objects.equals(name, memberDTO.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(buyerMemberId, buyerRoleId, memberId, roleId, name);
    }
}
